<template>
  <div class="app">
    <h2 ref="title">我是App组件</h2>
    <button @click="showTitle">提示标题</button>
    <button @click="showSchoolVC">打印School的vc</button>
    <button @click="showAppVC">打印App的vc</button>
    <Person ref="ren"/>
    <hr>
    <School ref="xuexiao"/>
  </div>
</template>

<script>
  import Person from './components/Person.vue'
  import School from './components/School.vue'

  export default {
    name:'App',
    components:{Person,School},
    methods: {
      showTitle(){
        console.log(this.$refs.title)
      },
      showSchoolVC(){
        console.log(this.$refs.xuexiao)
      },
      showAppVC(){
        console.log(this)
      }
    },
  }
</script>

<style>
  .app {
    background-color: gray;
    padding: 20px;
    border-radius: 10px;
  }
</style>